<?php $__env->startSection('title','首页'); ?>


<?php $__env->startSection('css'); ?>
<style type="text/css">
    .widget .row span{
      font-size: 15px;
      font-weight: bold;
    }
    .p-md{
        padding-top: 6px;
        padding-bottom: 0px;
        margin-top: 0px;
        margin-bottom: 30px;
    }
    .m-b-md{
        padding-top: 3px;
    }
    .page-heading{
        padding-bottom: 2px;
    }
    .alert{
        /*padding-bottom: 0px;*/
        padding-left: 23px;
        padding-right: 23px;
        margin-bottom: 0px;
    }
    .alert p{
        font-size: 14px;
        font-weight: 12px;
    }
    .alert a{
        text-decoration: underline;
    }
    .canceled{
        margin: 0;
        padding: 0;
    }
    #login-form {
        margin-top: 30px;
    }
    #login-form img{
        width: 100%;
        margin-left: 0;
    }
    #login-form {
        margin-bottom: 100px;
    }
</style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>

<div class="row wrapper border-bottom page-heading">
  <div class="col-sm-4">
      <h2><?php echo $__env->yieldContent('title'); ?></h2>
  </div>
</div>
<div id="login-form">
    <div class="logo">
        <img id="logo" src="<?php echo e(asset(getThemeAssets('img/logo2.png'))); ?>">
    </div>
  <div class="row">
      <div class="col-sm-6 col-lg-6">
      <form class="form-horizontal" method="post" action="<?php echo e(url('/repair/create')); ?>">
        <div class="form-group">
             <div class="box-header with-border">
                <div class="ibox-title">
                        <h5>最新公告</h5>
                </div>
             </div>
        </div>
        <div class="form-group">
          <div class="input-group">
            <div class="input-group-addon">
              <span class="glyphicon glyphicon-volume-up"></span>
            </div>
              <div class="alert alert-info">
                <p>您好，欢迎您的到来！此处下载获奖成果及教学建设模板Excel。</p>
                <p><a href="<?php echo e(url('admin/home/awardExcelDownload')); ?>">2018获奖成果Excel模板下载。</a></p>
                <p><a href="<?php echo e(url('admin/home/constrExcelDownload')); ?>">2018教学建设Excel模板下载。</a></p>
                <p><a href="<?php echo e(url('admin/home/academicExcelDownload')); ?>">2018学术成果Excel模板下载。</a></p>

              </div>  
          </div>
        </div>

      </form>
    </div>
    <div class="col-sm-6 col-lg-6">
      <form class="form-horizontal" method="" action="">
      <?php echo e(csrf_field()); ?>

        <div class="form-gro  up">
             <div class="box-header with-border">
                <div class="ibox-title">
                        <h5>系统反馈</h5>
                </div>
             </div>
        </div>
        <div class="form-group">
          <div class="input-group">
            <div class="input-group-addon">
              <span class="glyphicon glyphicon-list"></span>
            </div>
            <input type="text" class="form-control" name="title"
                   value="<?php echo e(old('title')); ?>" id="title" placeholder="留言标题" required>
          </div>  
        </div>
        <div class="form-group">
          <div class="input-group">
            <div class="input-group-addon">
              <span class="glyphicon glyphicon-user"></span>
            </div>
            <input type="email" class="form-control" id="email" name="email" placeholder="联系邮箱" required>
          </div>
        </div>
        <div class="form-group">  
          <div class="input-group">
            <div class="input-group-addon">
              <span class="glyphicon glyphicon-file"></span>
            </div>
            <input type="text" class="form-control" id="content" name="content" placeholder="留言内容" required>
          </div>
        </div>
            <div class="form-group" id="btn-group">
              <div class="col-sm-12">
                
                <button id="btn1" type="button" class="btn btn-primary btn-block">提交反馈</button>
              </div>
            </div>
      </form>
    </div>
  </div>

</div>
                        

<?php $__env->stopSection(); ?>
<?php $__env->startSection('js'); ?>
<script type="text/javascript">
    $(document).ready(function () {
        $('#btn1').click(function(event) {
            var noteinfo = [];
            noteinfo['title'] = $("#title").val();
            noteinfo['email'] = $("#email").val();
            noteinfo['content'] = $("#content").val();
            if (noteinfo['title'] == '') {
                swal("标题不能为空！", "","warning");
                  return;
            } 
            if (noteinfo['email'] == '') {
                swal("邮箱不能为空！", "","warning");
                $("#email").focus();
                return;
            }else {
                var email_vali = /^(\w)+@[a-zA-Z0-9]+(.com)$/;
                if (!email_vali.exec(noteinfo['email'])) {
                    swal("邮箱格式不正确，请检查！", "","warning");
                    $("#email").focus();
                    return;
                }
            }
            $.ajaxSetup ({
                     headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    }
            });
            // 对留言提交事件进行click触发监听
            $.ajax({  
                url: "<?php echo e(url('/admin/home/note')); ?>",
                type: 'post',
                headers: {
                            'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content')
                          },    
                // datatype: 'json',
                data: {title: $("#title").val(),email: $("#email").val(),
                       content: $("#content").val() 
                },    
                success: function(res) {
                    if (res['res'] == 1) {
                        $("#title").val('');
                        $("#content").val('');
                        swal("发表成功！","","success");
                    }else {
                        swal("发表失败！","","warning");
                    }
                }

            });   
        });
    });
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.'.getTheme(), array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>